'use client'

import { useState } from 'react'
import { PlusIcon } from '@heroicons/react/24/outline'
import { CreateSupplierDialog } from './create-supplier-dialog'

export function SupplierHeader() {
  const [isCreateOpen, setIsCreateOpen] = useState(false)

  return (
    <div className="flex justify-between items-center">
      <h1 className="text-2xl font-semibold text-gray-900">供应商管理</h1>
      <button
        onClick={() => setIsCreateOpen(true)}
        className="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
      >
        <PlusIcon className="h-5 w-5 mr-2" />
        新建供应商
      </button>
      <CreateSupplierDialog open={isCreateOpen} onClose={() => setIsCreateOpen(false)} />
    </div>
  )
} 